const {
  HYEventStore
} = require("hy-event-store")
import {
  getRecommendSong
} from "../network/music"
const rankingsIds = {
  newRanking: 3779629,
  originRanking: 2884035,
  upRanking: 19723756
}
export const rankStore = new HYEventStore({
  state: {
    newRanking: {}, //新歌榜
    originRanking: {}, //原创榜
    upRanking: {}, //飙升榜
  },
  actions: {
    async fecthRank(val) {
      for (let key in rankingsIds) {
        let id = rankingsIds[key]
         getRecommendSong(id).then(res=>{
          val[key] = res.playlist;
        })
        //  console.log(res);
      
        //   console.log(val[key]);
        // console.log(val[0]);
      }
    }
  }
})